﻿<phone:PhoneApplicationPage 
    x:Class="Cet.Develop.Windows.IO.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    
    <phone:PhoneApplicationPage.Resources>

        <LinearGradientBrush
            x:Key="BkgndBrush"
            StartPoint="0.25,0.0"
            EndPoint="0.75,1.0"
            >
            <GradientStop Offset="0.25" Color="Black" />
            <GradientStop Offset="1.0" Color="#FF0095D8" />
        </LinearGradientBrush>

    </phone:PhoneApplicationPage.Resources>
    
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--Assigns a background image to the Panorama control.-->
        <Grid.Background>
            <ImageBrush ImageSource="Images/panorama-background.png"/>
        </Grid.Background>

        <Border
            Grid.Row="0" Grid.Column="0"
            Background="{StaticResource BkgndBrush}"
            CornerRadius="16"
            >
        	<Image HorizontalAlignment="Right" Margin="0,8,8,0" Source="Images/cet-leaf.jpg" Stretch="Fill" Width="84" Height="80" VerticalAlignment="Top"/>
        </Border>
        
        <Canvas
            Grid.Row="0" Grid.Column="0"
            Height="240"
            >
            <Path
                Data="M4,5 L135,4 Q159,5 157,24 L157,84"
                Stroke="Gold"
                StrokeThickness="8"
                StrokeDashArray="1.5 1.5" Height="88" Canvas.Left="236" Canvas.Top="95" UseLayoutRounding="False" Width="161.154"
                />

            <Path
                Data="M290,215 h-100 q-20,0 -20,-20 v-20"
                Stroke="Gold"
                StrokeThickness="8"
                StrokeDashArray="1.5 1.5"
                />
            
            <Image
                Source="Images/netduino_small.png"
                Width="240"
                HorizontalAlignment="Left"
                />
        
            <TextBlock 
                Text="modbus" 
                FontFamily="Trebuchet MS"
                FontSize="48"
                Foreground="Indigo"
                Canvas.Left="302"
                Canvas.Top="182"
                />

            <TextBlock 
                Text="modbus" 
                FontFamily="Trebuchet MS"
                FontSize="48"
                Foreground="Lavender"
                Canvas.Left="300"
                Canvas.Top="180"
                />
            
            <TextBlock 
                Style="{StaticResource PhoneTextNormalStyle}"
                Canvas.Left="263"
                Canvas.Top="140" Margin="0" Height="63" TextAlignment="Center" Foreground="#FFC5FEFF"
                ><Run Text="Remote "/><LineBreak/><Run Text="Commander"/></TextBlock>

            <TextBlock 
                Text="M. Vernari (2012)" 
                FontSize="18"
                Foreground="Gray"
                Canvas.Left="5"
                Canvas.Top="210"
                />
        </Canvas>
        
        <!--ContentPanel - place additional content here-->
        <Border
            Grid.Row="1"
            BorderBrush="{StaticResource BkgndBrush}"
            BorderThickness="5"
            CornerRadius="16"
            Margin="0,12,0,0"
            >
            <Grid 
                x:Name="ContentPanel" 
                Margin="8"
                >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
            
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="48"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

            
                <!-- Grid Row 0: Remote Host Input Field >-->
                <TextBlock 
                    Grid.Row="0" Grid.Column="0" 
                    Text="Host Name:"  
                    VerticalAlignment="Center" 
                    HorizontalAlignment="Center" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" 
                    Margin="10,0,0,0"
                    />
            
                <TextBox 
                    x:Name="txtRemoteHost" 
                    Grid.Row="0" Grid.Column="1"  
                    Height="70" 
                    VerticalAlignment="Top" 
                    HorizontalAlignment="Stretch" 
                    FontSize="{StaticResource PhoneFontSizeNormal}"  
                    />

                <Button 
                    x:Name="btnDisconnect" 
                    Grid.Row="1" Grid.Column="0" 
                    Height="70"  
                    Content="Close" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" 
                    Click="btnDisconnect_Click"
                    IsEnabled="False"
                    />

                <Button 
                    x:Name="btnConnect" 
                    Grid.Row="1" Grid.Column="1" 
                    Height="70"  
                    Content="Connect" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" 
                    Click="btnConnect_Click"
                    />
            
                <ProgressBar
                    x:Name="pbarConnect"
                    Grid.Row="2" Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Value="0"
                    VerticalAlignment="Top"
                    Margin="50,30,50,10"
                    Visibility="Collapsed"
                    />
                
                <TextBlock 
                    Grid.Row="3" Grid.Column="0" 
                    Grid.ColumnSpan="2"
                    x:Name="txtStatus"  
                    VerticalAlignment="Top" 
                    HorizontalAlignment="Stretch" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" 
                    Margin="10"
                    />
            </Grid>
            
        </Border>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="False" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>